package model

import (
	"time"

	"github.com/astaxie/beego/orm"
)

type User struct {
	ID        int64      `orm:"column(id)"`
	Name      string     `orm:"size(32)`
	Password  string     `orm:size(1024)`
	Sex       bool       `orm:"-"`
	Tel       string     `orm:"size(32)`
	Addr      string     `orm:size(1024)`
	CreatedAt *time.Time `orm:"auto_now_add"`
	UpdatedAt *time.Time `orm:"auto_now"`
	DeletedAt *time.Time `orm:"null"`
}

func NewUser(id int64, name, password, addr string, sex bool) *User {
	return &User{
		ID:       id,
		Name:     name,
		Password: password,
		Sex:      sex,
		Addr:     addr,
	}

}

func init() {
	orm.RegisterModel(&User{})
}
